package com.hkbigdata.springbootmybatis.mapper;

import com.hkbigdata.springbootmybatis.bean.Department;
import org.apache.ibatis.annotations.*;

/**
 * @author liuanbo
 * @creat 2024-10-29-18:29
 * @see 2194550857@qq.com
 */
@Mapper
public interface DepartmentMapper {
    @Select("select * from department where id = #{id}")
    public Department findById(Integer id);

    @Delete("delete from department where id=#{id}")
    public int deleteById(Integer id);
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into department(department_name) values (#{departmentName})")
    public int insertDept(Department department);

    @Update("update department set departmnet_name = #{departmentName}" + " where id = #{id}")
    public int updateDept(Department department);



}
